package com.jshoperxms.controller.utils.enums;

/**
 * Created by sdywcd on 16/10/25.
 * Des:
 */
public class YdEnums {

    public enum TYPE {
        FIND("查看", "1"), SAVE("增加", "2"),EDIT("编辑","3"),DEL("删除","4");
        private String name;
        private String state;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        private TYPE(String name, String state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(String state) {
            for (TYPE type : TYPE.values()) {
                if (type.getState().equals(state)) {
                    return type.getName();
                }
            }
            return "";
        }
    }

    public enum TASKTYPE {
        VOICETASK("音频朗读任务", "recordtask"), PICTURETASK("图文朗读任务", "picturetask"),ANCIENTSINGLEBATTLETASK("古诗文单人任务","ancientsinglebattletask");
        private String name;
        private String state;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        private TASKTYPE(String name, String state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(String state) {
            for (TASKTYPE type : TASKTYPE.values()) {
                if (type.getState().equals(state)) {
                    return type.getName();
                }
            }
            return "";
        }
    }

    public enum TASKSTATUS {
        FINISH("任务完成", "1"), UNFINISH("任务未完成", "0");
        private String name;
        private String state;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        private TASKSTATUS(String name, String state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(String state) {
            for (TASKSTATUS type : TASKSTATUS.values()) {
                if (type.getState().equals(state)) {
                    return type.getName();
                }
            }
            return "";
        }
    }

    /**
     * 支付类型
     */
    public enum PAYBUSTYPE {
        PAYFORTEAMARTICLE("给小队文章打赏", "1");
        private String name;
        private String state;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        private PAYBUSTYPE(String name, String state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(String state) {
            for (PAYBUSTYPE type : PAYBUSTYPE.values()) {
                if (type.getState().equals(state)) {
                    return type.getName();
                }
            }
            return "";
        }
    }
}
